
	




local TOPBAR = {}

function TOPBAR:Init()
	self:SetMouseInputEnabled(false)
end

function TOPBAR:PerformLayout()
	self:SetPos( 0, 0 )
	self:SetSize( ScrW(), 24 )
end

function TOPBAR:ApplySchemeSettings()
end

function TOPBAR:Paint()

	local client = LocalPlayer()	
	local credits = LocalPlayer():GetNWInt( "credits" )
	local copper = LocalPlayer():GetNWInt( "copper" )
	local iron = LocalPlayer():GetNWInt( "iron" )
	local titanium = LocalPlayer():GetNWInt( "titanium" )
		


	
	local length     = -35 
	local spacer     = 40

	
	surface.SetFont( "Default" )
	
	surface.SetTextColor( 255, 255, 255, 255 )
	draw.RoundedBox(0, 0, 0, ScrW(), 24, Color(0, 0, 0, 150))
	draw.RoundedBox(0, 0, 24, ScrW(), 2, Color(255, 255, 255, 255))

	surface.SetTextPos( length + spacer, 5 )
		surface.DrawText( "Credits: " ..credits )
		local x, y = surface.GetTextSize( "Credits: " ..tostring(credits) )
		creditpos = ( length + spacer + (x / 2) )
		length = length + x + spacer
	
	surface.SetTextPos( length + spacer, 5 )	
		surface.DrawText( "Copper: " ..copper )
		local x, y = surface.GetTextSize( "Copper: " ..tostring(copper) )	
		goldpos = ( length + spacer + (x / 2) )
		length = length + x + spacer
		
	surface.SetTextPos( length + spacer, 5 )	
		surface.DrawText( "Iron: " ..iron )
		local x, y = surface.GetTextSize( "Iron: " ..tostring(iron) )	
		goldpos = ( length + spacer + (x / 2) )
		length = length + x + spacer

	surface.SetTextPos( length + spacer, 5 )	
		surface.DrawText( "Titanium: " ..titanium )
		local x, y = surface.GetTextSize( "Titanium: " ..tostring(titanium) )	
		goldpos = ( length + spacer + (x / 2) )
		length = length + x + spacer		
		
		
end	
	

vgui.Register("USRP Top Bar", TOPBAR, "Panel")

topbar = vgui.Create( "USRP Top Bar" )

topbar:SetVisible( true )


